<?php
if(have_posts())
{
	while (have_posts())
	{
		the_post();
		$postID = get_the_ID();
		$title = get_the_title($postID);
		$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
		$permalink = get_post_meta($postID,$wpdb->prefix.'url',true);
		if(!$permalink)
			$permalink = WP_MYSITE_URL;
		$alt = db_get_alt_attachment_id($postID, $wpdb->prefix.'thumbnail');
		if(!$alt)
			$alt = db_vietnamese_slug($title);
		?>
				<li><a href="<?php echo $permalink;?>"><img src="<?php echo $thumbnail;?>" alt="<?php echo $alt;?>" /></a>
                  <div class="textslidetop">
                  	<p><a href="<?php echo $permalink;?>"><?php echo $title;?></a></p>                  
                  </div>
                  <div class="bgslidetop"></div>
                  </li>
		<?php 
	}
}
else 
{
	echo '<li> No Slide show! </li>';
}
?>